#include "main/utils.h"
using namespace std;

string add(string input1, string input2) {
  string sum;
  int carry = 0;
  for (int i = input1.size() - 1, j = input2.size() - 1;
      i >= 0 || j >= 0; --i, --j) {
    char in1 = '0', in2 = '0';
    if (i >= 0) in1 = input1[i];
    if (j >= 0) in2 = input2[j];
    int sum_tmp = in1 - '0' + in2 - '0' + carry;
    if (sum_tmp >= 2) {
      carry = 1;
      sum_tmp -= 2;
    } else {
      carry = 0;
    }
    sum.push_back(sum_tmp + '0');
  }
  if (carry > 0)
    sum.push_back(carry + '0');

  reverse(sum.begin(), sum.end());
  return sum;
}

int main() {
  string sum = add("1111", "1101");
  cout << sum << endl;
}
